package config

import (
	"github.com/spf13/viper"
)

type Application struct {
	Domain        string
	Host          string
	IsHttps       bool
	Mode          string
	Name          string
	Port          string
	ReadTimeout   int
	WriterTimeout int
}

func NewApplication(cfg *viper.Viper) *Application {
	return &Application{
		Domain:        cfg.GetString("domain"),
		Host:          cfg.GetString("host"),
		IsHttps:       cfg.GetBool("ishttps"),
		Mode:          cfg.GetString("mode"),
		Name:          cfg.GetString("name"),
		Port:          cfg.GetString("port"),
		ReadTimeout:   cfg.GetInt("readtimeout"),
		WriterTimeout: cfg.GetInt("writetimeout"),
	}
}
